// LGUIPanel.cpp: implementation of the LGUIPanel class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "LGUIPanel.h"
#include "LGUIContainer.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LGUIPanel::LGUIPanel(int _x, int _y, int _w, int _h, int _color) : LGUIContainer(_x,_y,_w,_h)
{
  color=_color;
  isVisible=true;
}

void LGUIPanel::draw(int xoff, int yoff)
{
  if (isDirty)
  {
    
    buffer.rectFillFaded(x+xoff,y+yoff,x+xoff+w,y+yoff+6,COLOR(0xffffff),whitenColor(color));
    buffer.rectFillFaded(x+xoff,y+yoff+6,x+xoff+w,y+yoff+h/2,whitenColor(color),color);
    buffer.rectFill(x+xoff,y+yoff+h/2,x+xoff+w,y+yoff+h-8,color);//darkenColor(color),(color));
    buffer.rectFillFaded(x+xoff,y+yoff+h-8,x+xoff+w,y+yoff+h,color,darkenColor(color));
    
    //buffer.rectFill(x+xoff,y+yoff,x+xoff+w,y+yoff+h,color);
    buffer.addDirtyRect(*this);
    isDirty=false;
  }
  LGUIContainer::draw(xoff, yoff);
}